package com.cxf.windex.config;

import com.github.wxpay.sdk.WXPayConfig;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * @author chenxf
 * @date 3/27/2018
 * @description
 */
public class MyWxConfig implements WXPayConfig {
  private byte[] certData;

  private String appId,mchId,key;

  public MyWxConfig(String appId, String mchId, String key) {
    this.appId=appId;
    this.mchId=mchId;
    this.key=key;
  }

  @Override
  public InputStream getCertStream() {
    ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
    return certBis;
  }

  @Override
  public String getAppID() {
    return appId;
  }
  @Override
  public String getMchID() {
    return mchId;
  }
  @Override
  public String getKey() {
    return key;
  }


  @Override
  public int getHttpConnectTimeoutMs() {
    return 8000;
  }
  @Override
  public int getHttpReadTimeoutMs() {
    return 10000;
  }
}
